<template>
  <div class="main">
    <div class="rightone">
      <div class="jdrzl">
        <div class="title">酒店入住率</div>
        <div class="jdrznyum">
          <div class="jdrzlist">
            <div class="jdrzlabel">酒店总数</div>
            <div class="jdtotal">60</div>
          </div>
          <div class="jdrzlist">
            <div class="jdrzlabel">酒店入住率</div>
            <div id="jdrzlchart"></div>
          </div>
        </div>
        <div class="jdrzchart" id="jdrzchart"></div>
      </div>

      <div class="klpx" style="margin-top: 18px">
        <div class="title">入住客源省份排名</div>
        <div id="klchart" class="klchart"></div>
      </div>

      <div class="klpx" style="margin-top: 18px">
        <div class="title">年消费画像</div>
        <div id="klchart22" class="klchart22" ref="klchart22"></div>
      </div>
    </div>
  </div>
</template>
<script>
import * as echarts from "echarts";
// import "echarts/map/js/china.js";
export default {
  components: {},
  watch: {},
  created() {},
  data() {
    return {
      activeName: "1",
    };
  },
  mounted() {
    this.getdata4();
    this.getdata2();

    this.getChart18();

    this.getdata5();
  },
  methods: {
    getdata2() {
      const chartDom = document.getElementById("klchart");
      const myChart = echarts.init(chartDom);
      let option;

      option = {
        grid: {
          top: "15%",
          bottom: "10%",
          containLabel: true,
        },
        xAxis: {
          type: "category",
          axisLabel: {
            color: "#fff",
            interval: 0,
          },
          data: [
            "广东省",
            "广西省",
            "河北省",
            "山西省",
            "山东省",
            "青海省",
            "江西省",
          ],
        },
        yAxis: {
          type: "value",

          nameTextStyle: {
            color: "#fff",
          },
          axisLabel: {
            color: "#fff",
          },
        },
        series: [
          {
            data: [120, 200, 150, 80, 70, 110, 130],
            type: "bar",
            barWidth: 17,
            color: "#297bf7",
            itemStyle: {
              normal: {
                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                  {
                    offset: 0,
                    color: "#4386f5", // 起点颜色
                  },
                  {
                    offset: 1,
                    color: "#2af7c8", // 终点颜色
                  },
                ]),
                shadowColor: "rgba(0, 0, 0, 0)",
              },
            },
          },
        ],
      };
      option && myChart.setOption(option);
    },

    getChart18() {
      const myChart = echarts.init(this.$refs.klchart22);
      const option = {
        series: [
          {
            type: "wordCloud",
            gridSize: 20,
            sizeRange: [12, 50],
            rotationRange: [-90, 90],
            shape: "pentagon",
            textStyle: {
              color: function () {
                return (
                  "rgb(" +
                  Math.round(Math.random() * 255) +
                  ", " +
                  Math.round(Math.random() * 255) +
                  ", " +
                  Math.round(Math.random() * 255) +
                  ")"
                );
              },

              emphasis: {
                shadowBlur: 10,
                shadowColor: "#333",
              },
            },
            data: [
              { name: "春节", value: 10000 },
              { name: "春节", value: 5000 },
              { name: "游客", value: 6181 },
              { name: "游客", value: 6181 },
              { name: "40岁", value: 4386 },
              { name: "景区", value: 4055 },
              { name: "男生", value: 400 },
              { name: "女生", value: 400 },
              { name: "bigdata", value: 1000 },
              { name: "ola", value: 2000 },
              { name: "p", value: 4000 },
              { name: "vido", value: 400 },
              { name: "vido", value: 400 },
              { name: "e", value: 200 },
              { name: "shuffl", value: 200 },
              { name: "enenshtein", value: 200 },
              { name: "hbase", value: 2000 },
              { name: "sinaweibo", value: 200 },
              { name: "analysis", value: 600 },
              { name: "thread", value: 600 },
              { name: "meachine", value: 1600 },
              { name: "景区", value: 3000 },
              { name: "crawl", value: 1600 },
              { name: "mahout", value: 1600 },
            ],
          },
        ],
      };
      myChart.setOption(option);
      window.addEventListener("resize", function () {
        myChart.resize();
      });
    },

    getChers8() {
      var chartDom = document.getElementById("hxLine");
      var myChart = echarts.init(chartDom);
      var option;
      var colorArray = [
        {
          top: "#826AF9",
        },
        {
          top: "#FFE700",
        },
        {
          top: "#FF6C40",
        },
        {
          top: "#6CA842",
        },
        {
          top: "#1DC1DF",
        },
        {
          top: "rgba(215,47,215)", //粉
        },
      ];

      option = {
        // backgroundColor: '#0E2A43',

        grid: {
          left: "3%",
          right: "4%",
          bottom: "6%",
          top: "6%",
          containLabel: true,
        },

        tooltip: {
          show: "true",
          trigger: "axis",
          axisPointer: {
            type: "shadow",
          },
        },
        xAxis: {
          type: "value",
          position: "bottom",
          axisTick: {
            show: false,
          },
          axisLine: {
            show: false,
            lineStyle: {
              color: "#fff",
            },
          },
          splitLine: {
            show: true,
          },
        },
        yAxis: [
          {
            type: "category",
            axisTick: {
              show: false,
              // alignWithLabel: true,
              // length: 5,
            },
            inverse: "true", //排序
            axisLine: {
              show: true,
              lineStyle: {
                color: "#1FCEF8",
              },
            },

            data: ["安徽省", " 江苏省", "湖北省", "贵州省", "云南省"],
          },
        ],
        series: [
          {
            name: "能耗值",
            type: "bar",
            itemStyle: {
              normal: {
                show: true,
                color: function (params) {
                  let num = colorArray.length;
                  return {
                    type: "linear",
                    colorStops: [
                      {
                        offset: 1,
                        color: colorArray[params.dataIndex % num].top,
                      },
                      {
                        offset: 1,
                        color: colorArray[params.dataIndex % num].top,
                      },
                      {
                        offset: 1,
                        color: colorArray[params.dataIndex % num].top,
                      },
                      {
                        offset: 1,
                        color: colorArray[params.dataIndex % num].top,
                      },
                      {
                        offset: 1,
                        color: colorArray[params.dataIndex % num].top,
                      },
                      {
                        offset: 1,
                        color: colorArray[params.dataIndex % num].top,
                      },
                    ],
                    //globalCoord: false
                  };
                },
                // barBorderRadius:88,
                // borderWidth:5,
                // borderColor: '#333',
              },
            },
            barGap: "0%",
            barCategoryGap: "70%",
            data: [60, 132, 101, 134, 180],
          },
        ],
      };
      option && myChart.setOption(option);
    },

    getdata5() {
      const chartDom = document.getElementById("jdrzchart");
      const myChart = echarts.init(chartDom);
      let option;

      option = {
        xAxis: {
          type: "category",
          axisLabel: {
            color: "#fff",
          },
          data: ["1星级", "2星级", "3星级", "4星级"],
        },
        yAxis: {
          type: "value",
          name: "酒店等级",
          nameTextStyle: {
            color: "#fff",
          },
          axisLabel: {
            color: "#fff",
          },
        },
        series: [
          {
            data: [120, 200, 150, 80, 70, 110, 130],
            type: "bar",
            color: "#297bf7",
          },
        ],
      };
      option && myChart.setOption(option);
    },
    getdata4() {
      const chartDom = document.getElementById("jdrzlchart");
      const myChart = echarts.init(chartDom);
      let option;

      option = {
        tooltip: {
          trigger: "item",
        },
        legend: {
          show: false,
        },
        series: [
          {
            type: "pie",
            radius: ["70%", "90%"],
            avoidLabelOverlap: false,
            label: {
              show: true,
              position: "center",
              color: "#fff",
              textStyle: {
                fontSize: 12, // 字体大小
                lineHeight: 60, // 行高设置为30px
              },

              formatter: function (e) {
                return `80%`;
              },
            },

            labelLine: {
              show: false,
            },
            color: ["#616a5c", "#297bf7"],
            data: [
              { value: 1048, name: "总数" },
              { value: 735, name: "未处理" },
            ],
          },
        ],
      };
      option && myChart.setOption(option);
    },
  },
};
</script>
<style scoped>
#whchart {
  width: 100%;
  height: 257px;
}
#whchart0 {
  width: 100%;
  height: 257px;
}
.ljtitle {
  padding-left: 10px;
  box-sizing: border-box;
  color: #fff;
}
.whcg {
  width: 100%;
  height: 307px;
  margin-top: 17px;
  background: rgba(3, 8, 13, 0.6);
  border-radius: 8px;
  padding: 15px;

  box-sizing: border-box;
}
.whcsimg img {
  width: 100%;
  height: 100%;
}
.whcsnum {
  width: calc(100% - 74px);
  height: auto;
  padding-top: 25px;
  float: left;
  box-sizing: border-box;
}
.whcsimg {
  width: 74px;
  height: 102px;
  float: left;
}
.whcs:nth-child(2n) {
  margin-right: 0px !important;
  margin-bottom: 0px !important;
}
.whcs {
  width: 191px;
  height: 102px;
  margin-right: 5px;
  overflow: hidden;
  float: left;
  padding: 5px;
  box-sizing: border-box;
  background: #0a100c;
  margin-bottom: 10px;
}
.kljclist {
  width: 100%;
  height: auto;
  margin-top: 18px;
  overflow: hidden;
}
.jdrzchart {
  width: 100%;
  height: 237px;
  /* margin-top: 23px; */
}
#jdrzlchart {
  width: 90px;
  height: 90px;
}
.jdtotal {
  width: 137px;
  height: 81px;
  border-radius: 10px;
  line-height: 81px;
  text-align: center;
  font-size: 60px;
  font-weight: bold;
  color: #01ffff;
  background: #1d443b;
}
.jdrzlabel {
  color: #fff;
  text-align: left;
  margin-bottom: 10px;
}
.jdrzlist {
  width: 50%;
  float: left;
  height: auto;
}
.jdrznyum {
  width: 100%;
  height: auto;
  margin-top: 18px;
  overflow: hidden;
}
.jdrzl {
  margin-top: 18px;
  width: 100%;
  height: 404px;
  background: rgba(3, 8, 13, 0.6);
  border-radius: 8px;
  padding: 15px;

  box-sizing: border-box;
}
.whcskljc {
  width: 100%;
  height: 305px;
  background: rgba(3, 8, 13, 0.6);
  border-radius: 8px;
  padding: 15px;

  box-sizing: border-box;
}
.colnum span {
  font-size: 30px;
  font-weight: bold;
  color: #297bf7;
  font-style: italic;
}
.colnum {
  color: #fff;
  font-size: 14px;
  text-align: center;
}
.colltitle {
  text-align: center;
  color: #fff;
}
.colls {
  width: 33.3%;
  height: auto;
  float: left;
}
.collslist {
  margin-top: 32px;
  width: 100%;
  height: auto;
  overflow: hidden;
}
.bhd span {
  color: #01ffff;
}
.bhd {
  position: absolute;
  right: 120px;
}
/* .jrjq {
  width: 71px;
  height: 25px;
  color: #fff;
  float: right;
  position: absolute;
  background: #2a63e5;
  line-height: 25px;
  right: 25px;
  border-radius: 5px;
  text-align: center;
  background: #2a63e5;
} */
.jqgk {
  width: 100%;
  height: 532px;
  background: rgba(3, 8, 13, 0.6);
  border-radius: 8px;
  padding: 15px;

  box-sizing: border-box;
}
.rightone {
  width: 420px;
  height: auto;
  /* margin-left: 19px; */
  /* float: right; */
}
#oldchart {
  width: 100%;
  height: 161px;
}
#oldchart1 {
  width: 100%;
  height: 141px;
}
.yknlcf {
  margin-top: 10px;
  text-align: left;
  color: #fff;
}

.ykcftj {
  color: #fff;
  text-align: left;
  margin-top: 45px;
}
.yqtitle {
  font-size: 10px;
  margin-top: -37px;
  text-align: center;
  color: #eff0ef;
}

.yqpxlb {
  width: 100%;
  height: auto;
  display: flex;
  justify-content: space-around;
}
.yqxlln {
  width: 33.3%;
  height: auto;
}
.ykcf {
  width: 100%;
  height: 405px;
  background: rgba(3, 8, 13, 0.6);
  border-radius: 8px;
  padding: 15px;
  margin-top: 16px;
  box-sizing: border-box;
}
.kytj {
  width: 100%;
  height: 533px;
  background: rgba(3, 8, 13, 0.6);
  border-radius: 8px;
  padding: 15px;
  box-sizing: border-box;
}
.lefttwo {
  width: 420px;
  height: auto;
  float: left;
  margin-left: 19px;
}
.ndimg img {
  width: 100%;
  height: 100%;
}
.ndimg {
  width: 100%;
  height: 94px;
}
.ndklfx {
  margin-top: 18px;
  margin-bottom: 10px;
  color: #fff;
}
.jcmapright div img {
  vertical-align: middle;
}
.jcmapright div {
  color: #fff;
}
.jcmapright {
  width: 40%;
  float: left;
}
.jcnum {
  display: inline-block;
  color: #fff;
}
.jcnum span {
  font-size: 20px;
  color: #4af3ff !important;
  font-weight: bold;
  font-style: italic;
}
.jcmapleft {
  width: 60%;
  height: auto;
  float: left;
}
.jcmap {
  width: 100%;
  height: auto;
  overflow: hidden;
  margin-top: 7px;
}
.kljc1 {
  margin-top: 15px;
  width: 100%;
  height: 700px;
  background: rgba(3, 8, 13, 0.6);
  border-radius: 8px;
  padding: 15px;
  box-sizing: border-box;
}

.numm1 {
  width: 50%;
  float: left;
}
.label {
  color: #fff;
  text-align: left;
}
.value span {
  font-size: 20px;
  color: #297bf7 !important;
  font-weight: bold;
  font-style: italic;
}
.value {
  color: #fff;
  text-align: left;
  margin-top: 5px;
}
.value1 span {
  font-size: 20px;
  color: #ff7d4a !important;
  font-weight: bold;
  font-style: italic;
}
.value1 {
  color: #fff;
  text-align: left;
  margin-top: 5px;
}
.numm {
  width: 100%;
  height: auto;
  margin-top: 16px;
  overflow: hidden;
}
.ryall span {
  font-size: 20px;
  color: #3abac0 !important;
  font-weight: bold;
  font-style: italic;
}
.ryall {
  margin-top: 25px;
  color: #fff;
}
.kljc {
  width: 100%;
  height: 419px;
  background: rgba(3, 8, 13, 0.6);
  border-radius: 8px;
  padding: 15px;
  box-sizing: border-box;
}
.leftone {
  width: 419px;
  height: auto;
  float: left;
}
.main {
  position: absolute;
  right: 22px;
  top: 90px;
  width: 420px;
}
.leftBxo {
  width: 23%;
  display: flex;
}

.rightBxo {
  width: 23%;
  display: flex;
}
.title {
  font-size: 24px;
  font-family: YouSheBiaoTiHei, YouSheBiaoTiHei-Regular;
  font-weight: 600;
  text-align: left;
  font-style: italic;
  color: #ffffff;
}

.ljpm {
  width: 100%;
  height: 35px;
  border: 1px dashed #fff;
  margin-top: 5px;
  color: #fff;
  line-height: 35px;
  padding: 0px 5px;
  box-sizing: border-box;
}

.jknum {
  color: #0091fe;
  font-weight: bold;
  font-style: italic;
  font-size: 20px;
  margin: 0px 5px;
}
.kynum {
  color: #43d7b5;
  font-weight: bold;
  font-style: italic;
  font-size: 20px;
  margin: 0px 5px;
}

.jrjq {
  position: absolute;

  line-height: 14px;
  right: 14px;
}

.bhd span {
  color: #dfb704;
}
.bhd {
  position: absolute;
  right: 56px;
}

.klpx {
  width: 100%;
  height: 250px;
  background: rgba(3, 8, 13, 0.6);
  border-radius: 8px;
  padding: 15px;
  box-sizing: border-box;
}
.klchart {
  width: 100%;
  height: 180px;
  margin-top: 18px;
}
.klchart22 {
  width: 100%;
  height: 180px;
  margin-top: 18px;
}
</style>
<style>
.collapseZdy .el-collapse-item__header {
  background-color: rgba(1, 255, 255, 0.16);
  border-radius: 3px 3px 0px 0px;
  font-size: 14px;
  font-family: Source Han Sans SC, Source Han Sans SC-Regular;
  font-weight: 400;
  text-align: left;
  color: #ffffff;
  padding-left: 6px;
  border-bottom: 3px solid #01ffff;
  position: relative;
  margin-bottom: 10px;
}
.collapseZdy {
  border-top: 1px solid transparent;
  border-bottom: 1px solid transparent;
}
.collapseZdy .el-collapse-item__wrap {
  background-color: transparent !important;
  border-bottom: none !important;
  color: #fff !important;
}
.collapseZdy .el-collapse-item__content {
  color: #fff !important;
  padding-bottom: 0;
}
.moren {
  padding: 6px 8px;
  height: 14px;
  background: rgba(255, 255, 255, 0.15);
  border: 0.5px solid #47b2b5;
  border-radius: 3px;
  box-shadow: 0px 1.5px 3px 0px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(15px);
  font-size: 12px;
  font-family: AlibabaPuHuiTi-Regular;
  font-weight: normal;
  text-align: center;
  color: #ffffff;
  line-height: 14px;
  margin-left: 10px;
}
.active {
  background: #47b2b5;
  border: 1px solid #47b2b5;
  border-radius: 3px;
  box-shadow: 0px 1.5px 3px 0px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(15px);
}

.jdgk {
  width: 100%;
  height: 230px;
  background: rgba(3, 8, 13, 0.6);
  border-radius: 8px;
  padding: 15px;
  box-sizing: border-box;
}
</style>

<style>
.collapseZdy .el-collapse-item__header {
  background-color: rgba(1, 255, 255, 0.16);
  border-radius: 3px 3px 0px 0px;
  font-size: 14px;
  font-family: Source Han Sans SC, Source Han Sans SC-Regular;
  font-weight: 400;
  text-align: left;
  color: #ffffff;
  padding-left: 6px;
  border-bottom: 3px solid #01ffff;
  position: relative;
  margin-bottom: 10px;
  height: 40px;
}
.collapseZdy {
  border-top: 1px solid transparent;
  border-bottom: 1px solid transparent;
}
.collapseZdy .el-collapse-item__wrap {
  background-color: transparent !important;
  border-bottom: none !important;
  color: #fff !important;
}
.collapseZdy .el-collapse-item__content {
  color: #fff !important;
  padding-bottom: 0;
  height: 100%;
}

.el-collapse-item__arrow {
  position: absolute;
  color: #297bf7;
  /* margin-left: -64px !important; */
}
</style>
